An Introduction to Retro Native Forth

Retro Native Forth is a project seeking to create an operating system for personal computers. It is a minimal player in the vast field of mainstream and alternative operating systems running on the 80x86 architecture that powers most personal computers. It is different than the others because of its focus. We aim for simplicity in every area.

Since the creation of Unix nearly every operating system has been based on its design. And no wonder: Unix is simple in theory. At the heart of Unix is a kernel, one that builds an entire enterprise-capable operating system over six system calls. Through the years these have been expanded, revised, and now number in the hundreds. It went from a simple kernel and a few basic tools to a massive, multigigabyte operating system that can't be fully grasped by one person.

Retro is an attempt to move past Unix by providing a simple, bloat-free environment. It is guided by a broad, yet focused vision, originally outlined by Tom Novelli[1]. It is implemented in assembly and Forth, and defines a minimal subset of the Forth programming language on which an entire operating system can be built.

Forth was chosen for its simplicity. There are a number of definite advantages to using Forth. First, it is easily extensible. Each time you write a Forth program, you are literally extending the language. This leads to the second advantage, that of factoring. Since programs are really extensions of the language, reuse of subroutines (called words in Forth) is desirable. Programs are often written and rewritten, factoring out common bits of code. Each of these words can be used in other programs easily. The use of threaded code in the compiler saves space and also helps reduce complexity.

By writing Retro in Forth, and providing a Forth compiler/interpreter we leverage the full power of Forth. As an example I wrote a tiny assembler in Forth. This is used to compile many of the low-level words in Retro Forth. The size of the source code is just 244 bytes. It's even smaller after compiling. Other programs can be small as well. Retro has an editor that takes just 402 bytes of Forth code. In recent versions, a sidebar with support for plugins was written, it is a mere 704 bytes of code. Try to match that in a traditional programming language. The total size of the kernel + forth code? Just 8,402 bytes. And 2k of that is the VGA font, so the actual code is about 6k. Not much at all, especially considering its various features.

Retro is not an operating system in the modern sense. Todays operating systems provide nearly everything out of the box. You get multimedia tools (movie, audio, CD-ROM players and recorders), word processors, web browser, firewalls, web servers, and just about anything else you could ever want, and probably some things you don't. Retro is different. It provides a few basic building blocks on which a full system can be built. Instead of a complete system, it provides a basic console interface; a Forth compiler/interpreter; and a basic editor. From there anything you want can be built. Indeed, a full system is being built by those involved in the project. It won't be long before we can show off a clean, compact, good looking, and easy to use operating system.

In conclusion, Retro is a simpler operating system. It isn't done (is any decent program ever complete?), but shows a lot of potential. Keep in mind: Retro is, and will always be, a simpler alternative to those willing to make a break from legacy software.

Footnotes (Make links?)
[1] The Design Philosophy of RETRO Native Forth
[2] Three Instruction Forth (From PygmyForth)
[3] Need examples of a big Forth system
